from flask import jsonify

def makeResponse(data=None, msg=None, code=200):
    response = {
        'code': code,
        'msg': msg,
        'data': data
    }
    return jsonify(response)

def makeSuccess(data=None):
    response = {
        'code': 200,
        'msg': 'success',
        'data': data
    }
    return jsonify(response)

def makeError(msg):
    response = {
        'code': 500,
        'msg': msg
    }
    return jsonify(response)